package com.daekwang.util;

import java.io.IOException;
import java.io.PrintWriter;

import javax.servlet.http.HttpServletResponse;

public class StreamingResult {
	private String jsonStrig;
	private HttpServletResponse response;

	public StreamingResult(HttpServletResponse resp, String jsonStrig) {

		this.jsonStrig = jsonStrig;
		this.response = resp;

		print();
	}

	private void print() {

		try {
			response.setContentType("text/html;charset=UTF-8");
			PrintWriter write = response.getWriter();
			write.print(jsonStrig);
			write.flush();
			write.close();
		} catch (IOException e) {
			// TODO Auto-generated catch block
			e.printStackTrace();
		}
	}		
}
